package com.star.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@ApiModel(description = "员工登录时传递的数据模型")
public class BusinessLoginDTO implements Serializable {

    @ApiModelProperty("用户名")
    @NotNull(message = "用户名不能为空")
    @Size(min = 2, max = 10, message = "用户名长度必须在2到10个字符之间")
    @Pattern(regexp = "^[0-9]+$", message = "用户名只能包含数字")
    private String username;

    @ApiModelProperty("密码")
    @NotNull
    @Size(min = 6, max = 18, message = "密码长度必须在6到18个字符之间")
    @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "用户名只能包含数字和字母")
    private String password;

}
